package com.lagou.sqlSession;

import java.util.List;

public interface SqlSession {


	/**
	 * 查询所有
	 *
	 * @param statementid
	 * @param params
	 * @param <E>
	 * @return
	 * @throws Exception
	 */
	<E> List<E> selectList(String statementid, Object... params) throws Exception;


	/**
	 * 根据条件查询单个
	 *
	 * @param statementid
	 * @param params
	 * @param <T>
	 * @return
	 * @throws Exception
	 */
	<T> T selectOne(String statementid, Object... params) throws Exception;

	/**
	 * @param statementid
	 * @return
	 */
	int delete(String statementid) throws Exception;

	/**
	 * @param statementid
	 * @param params
	 * @return
	 * @throws Exception
	 */
	int delete(String statementid, Object... params) throws Exception;

	/**
	 * @param statementid
	 * @return
	 */
	int insert(String statementid) throws Exception;

	/**
	 * 添加
	 *
	 * @param statementid
	 * @param params
	 * @return
	 */
	int insert(String statementid, Object... params) throws Exception;

	/**
	 * @param statementid
	 * @return
	 */
	int update(String statementid) throws Exception;

	/**
	 * @param statementid
	 * @param params
	 * @return
	 */
	int update(String statementid, Object... params) throws Exception;

	//为Dao接口生成代理实现类
	<T> T getMapper(Class<?> mapperClass) throws Exception;


}
